<?php
include("config.php");  
$id = $_GET["id"];
$prev_id="";
$next_id="";
$newsDetail="";


$sql = "SELECT * FROM `news` ORDER BY `news`.`publicTime` DESC";
$rs = &$conn->Execute($sql);

if ($rs)
{
	while ($arr = $rs->FetchRow()) 
	{
		if($arr["id"]==$id)
		{
			$newsDetail= $arr;
			$next_arr = $rs->FetchRow();
			$next_id=$next_arr["id"];
			break;
		}
		else
		{
			$prev_id=$arr["id"];
		}
    }
}		 


//print_r($prev_id);
//print_r($next_id);
//print_r($newsDetail);



$tpl->assign("prev_id",$prev_id);
$tpl->assign("next_id",$next_id);
$tpl->assign("newsDetail",$newsDetail);
$tpl->display('news_detail.html');
?>